//
// Created by 谢哲 on 2021/5/18.
//

#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
using namespace std;

vector<int> vdata(26, -1);
int vfind(int pos) {
    if (vdata[pos]==-1) return pos;
    return vdata[pos] = vfind(vdata[pos]);
}

void vmerge(int pos1, int pos2) {
    int p1 = vfind(pos1), p2 = vfind(pos2);
    if (p1!=p2) vdata[p1] = p2;
}

class Edge {
public:
    multiset<string> edge;
    int rudu=0, chudu=0;
};
vector<Edge> edge_data(26);
vector<bool> has_edge(26, false);

map<string, int> visited;

vector<string> ans;
bool dfs(int pos, int remain) {
    if (remain == 0) {
        return true;
    }
    for (const auto &edge: edge_data[pos].edge) {
        if (visited[edge]==0) continue;
        visited[edge]-=1;
        ans.emplace_back(edge);
        bool result = dfs(edge.back()-'a', remain-1);
        if (result) return true;
        ans.pop_back();
        visited[edge]+=1;
    }
    return false;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int n;
    cin >> n;

    for (int i=0; i<n; ++i) {
        string s;
        cin >> s;
        has_edge[s.front()-'a'] = true, has_edge[s.back()-'a'] = true;
        vmerge(s.front()-'a', s.back()-'a');
        edge_data[s.front()-'a'].chudu++;
        edge_data[s.back()-'a'].rudu++;
        edge_data[s.front()-'a'].edge.insert(s);
        visited[s]+=1;
    }

    // Check one
    int parent = -1;
    int start_pos = -1, end_pos = -1;
    int min_start_pos = 99999;
    for (int i=0;i<26;++i) {
        if (!has_edge[i]) continue;
        min_start_pos = min(i, min_start_pos);
        if (parent == -1)
            parent = vfind(i);
        if (vfind(i)!=parent) {
            // Not one
            cout << "***";
            return 0;
        }
        if (edge_data[i].rudu==edge_data[i].chudu-1) {
            if (start_pos>=0) {
                cout << "***";
                return 0;
            }
            start_pos = i;
        }
        else if (edge_data[i].rudu==edge_data[i].chudu+1) {
            if (end_pos >= 0) {
                cout << "***";
                return 0;
            }
            end_pos = i;
        }
    }

    if (start_pos==-1) start_pos=min_start_pos;
    dfs(start_pos, n);

    for (int i=0;i<n-1;++i) {
        cout << ans[i] << ".";
    }
    cout << ans.back();

    return 0;
}
